<h1>GC</h1>
<h2>Alunos</h2>
<table border="1">
    <thead>
        <tr>
            <th>Id</th>
            <th>Nome</th>
            <th>Turma</th>

            <?php foreach ($gc_disciplinas as $gc_disciplina): ?>
                <th><?php echo $gc_disciplina->getNome(); ?></th>
            <?php endforeach ?>

        </tr>
    </thead>
    <tbody>


        <?php foreach ($gc_alunos as $i => $gc_aluno): ?>
            <tr>

                <td><?php echo link_to($gc_aluno->getId(), 'alunos_edit', $gc_aluno); ?></td>
                <td><?php echo $gc_aluno->getNome() ?></td>
                <td><?php echo $gc_aluno->getTurma() ?></td>

                <?php foreach ($gc_disciplinas as $gc_disciplina): ?>
                    <td> 
                        <?php echo $gc_aluno->verificarDisciplina($gc_disciplina->getNome()) ? link_to($gc_aluno->pegarMedia($gc_disciplina->getNome()),"aluno_disciplina_edit", $gc_aluno->pegarAlunoDisciplina($gc_disciplina)) : '-' ?>
                    </td>


                <?php endforeach ?>

            </tr>

        <?php endforeach ?>
    </tbody>
</table>

<a href="<?php echo url_for('alunos_new') ?>">Adicionar Aluno</a>

<a href="<?php echo url_for('disciplinas') ?>">Lista de Disciplinas</a>
